<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>打字游戏</title>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="style.css">
</head>
<body class="font-inter bg-gradient-game min-h-screen flex items-center justify-center text-light overflow-hidden">
    
    <button id="settings-btn" class="fixed bottom-8 left-8 z-50 bg-primary hover:bg-primary/90 text-white p-3 rounded-full shadow-lg transition-custom scale-hover">
        <i class="fa fa-cog text-xl"></i>
    </button>

    
    <div id="settings" class="fixed top-0 left-0 w-full bg-dark/95 p-6 transform -translate-y-full transition-transform duration-300 ease-in-out z-40">
        <div class="container mx-auto max-w-md">
            <h2 class="text-2xl font-bold mb-4 text-primary">难度设置</h2>
            <div class="bg-dark/80 rounded-xl p-6 shadow-2xl">
                <div class="mb-4">
                    <label for="difficulty" class="block text-lg font-medium mb-2">选择难度</label>
                    <select id="difficulty" class="w-full bg-dark/50 border border-primary/30 rounded-lg p-3 text-light focus:outline-none focus:ring-2 focus:ring-primary">
                        <option value="easy">简单 (每次正确+5秒)</option>
                        <option value="medium" selected>中等 (每次正确+3秒)</option>
                        <option value="hard">困难 (每次正确+2秒)</option>
                    </select>
                </div>
                <button id="close-settings" class="w-full bg-primary hover:bg-primary/90 text-white py-3 rounded-lg font-medium transition-custom scale-hover">
                    确认
                </button>
            </div>
        </div>
    </div>

    
    <div class="container mx-auto px-4 py-8 max-w-3xl relative z-10">
        <div class="bg-dark/50 backdrop-blur-md rounded-2xl shadow-2xl p-8 border border-primary/20">
            <div class="text-center mb-10">
                <h1 class="text-[clamp(2rem,5vw,3.5rem)] font-bold text-transparent bg-clip-text bg-gradient-to-r from-primary to-secondary mb-2 text-shadow">
                    打字挑战
                </h1>
                <p class="text-lg text-light/70 max-w-xl mx-auto">快速输入下方显示的单词，提升你的打字速度和准确性！</p>
            </div>

            
            <div class="game-area">
                <div id="word" class="text-[clamp(5rem,10vw,8srem)] font-bold text-center mb-8 text-primary transition-all duration-300"></div>
                
                <div class="relative max-w-md mx-auto">
                    <input type="text" id="text" placeholder="开始输入..." class="w-full bg-dark/70 border border-primary/40 rounded-xl py-18 px-24 text-9xl text-center focus:outline-none focus:ring-9 focus:ring-primary/70 transition-custom placeholder:text-6xl">
                    </div>
                </div>

                
                <div class="flex justify-between mt-10 gap-4">
                    <div class="bg-dark/70 rounded-xl p-6 flex-1 text-center transform transition-all duration-300 hover:scale-105">
                        <p class="text-light/70 text-lg font-medium">分数</p>
                        <p id="score" class="text-4xl font-bold text-primary">0</p>
                    </div>
                    <div class="bg-dark/70 rounded-xl p-6 flex-1 text-center transform transition-all duration-300 hover:scale-105">
                        <p class="text-light/70 text-lg font-medium">剩余时间</p>
                        <p id="time" class="text-4xl font-bold text-secondary">10</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

   
    <div id="end-game-container" class="fixed inset-0 bg-dark/90 flex flex-col items-center justify-center z-50 opacity-0 pointer-events-none transition-opacity duration-500">
        <div class="bg-dark/80 backdrop-blur-lg rounded-2xl shadow-2xl p-12 max-w-md w-full mx-4 border border-primary/30 transform scale-95 transition-all duration-500">
            <div class="text-center mb-8">
                <div class="inline-flex items-center justify-center w-20 h-20 rounded-full bg-primary/20 mb-6">
                    <i class="fa fa-trophy text-4xl text-primary"></i>
                </div>
                <h2 class="text-4xl font-bold mb-4 text-light">时间结束了！</h2>
                <p class="text-xl text-light/70 mb-2">你的打字挑战结果</p>
            </div>
            
            <div class="bg-dark/60 rounded-xl p-8 mb-8">
                <div class="flex justify-between items-center mb-6 pb-6 border-b border-primary/20">
                    <span class="text-xl text-light/70">最终得分</span>
                    <span id="final-score" class="text-4xl font-bold text-primary">0</span>
                </div>
                <div class="flex justify-between items-center">
                    <span class="text-xl text-light/70">难度</span>
                    <span id="final-difficulty" class="text-3xl font-bold text-secondary">中等</span>
                </div>
            </div>
            
            <button id="play-again-btn" class="w-full bg-primary hover:bg-primary/90 text-white py-5 rounded-xl font-bold text-2xl transition-custom scale-hover">
                再来一次 <i class="fa fa-refresh ml-2"></i>
            </button>
        </div>
    </div>

    <script src="script.js"></script>
</body>
</html>
    